package practice09;

import java.util.Objects;

public class Person {
    private int id;
    private String name;
    private Integer age;
    public Person(int i, String name, Integer age){
        this.id=i;
        this.name=name;
        this.age=age;
    }

    public Person(String name,Integer age){
        this.age=age;
        this.name=name;
    }

    public Integer getId() {
        return id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return id == person.id ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age);
    }

    public Integer getAge() {
        return age;
    }
    public String getName(){
        return name;
    }
    public String introduce(){
        return "My name is"+" "+getName()+". I am "+getAge()+" years old.";
    }
}
